package com.qingke.servlets;

import javax.servlet.ServletContextAttributeEvent;
import javax.servlet.ServletContextAttributeListener;
import javax.servlet.annotation.WebListener;

@WebListener
public class AttributeEventListenerTest implements ServletContextAttributeListener {

    public AttributeEventListenerTest() {
   
    }
    
    public void attributeAdded(ServletContextAttributeEvent event)  { 
    	String name = event.getName();
    	String value = event.getValue().toString();
    	System.out.print("add: ");
    	System.out.println("name:"+name+" value:"+value);
    }
    
    public void attributeRemoved(ServletContextAttributeEvent event)  { 
    	String name = event.getName();
    	String value = event.getValue().toString();
    	System.out.print("remove: ");
    	System.out.println("name:"+name+" value:"+value);
    }

    public void attributeReplaced(ServletContextAttributeEvent event)  { 
    	String name = event.getName();
    	String value = event.getValue().toString();
    	System.out.print("replace: ");
    	System.out.println("name:"+name+" value:"+value);
    }
	
}
